class CreatePhotos < ActiveRecord::Migration
  def self.up
    create_table :photos do |t|
      t.column(:album_id, :integer)
      t.column(:title, :string)
      t.column(:image,:string)
      t.column(:view_count, :integer,:default=>0)
      t.column(:comments_count, :integer,:default=>0)
      t.column(:created_at,:datetime)
    end
    # execute "alter table photos add constraint fk_photos_albums foreign key(album_id) references albums(id)"
  end

  def self.down
    drop_table :photos
  end
end
